<template>
  <KView class="goods-order-activity">
    <KView v-if="order.activityName">商品：{{order.activityName}}</KView>

    <KView>下单时间：{{order.getDatetimeValue('createTime','YYYY-MM-DD HH:mm:ss')}}</KView>

    <KView v-if="order.status===1||order.status===2">支付时间：{{order.getDatetimeValue('payTime','YYYY-MM-DD HH:mm:ss')}}</KView>
    <KView v-else-if="order.status===3">退款时间：{{order.getDatetimeValue('refuseTime','YYYY-MM-DD HH:mm:ss')}}</KView>
    <KView v-else-if="order.status===-1">取消时间：{{order.getDatetimeValue('cancelTime','YYYY-MM-DD HH:mm:ss')}}</KView>
    <KView v-if="order.status===3">退款金额：¥{{order.refusePrice}}</KView>

    <KView v-if="order.type==='NOGOODS'&&order.status===1" class="goods-order-activity-btn" @click="applyRetreat">申请退款</KView>
  </KView>
</template>

<script>
  export default {
    props: {
      order: {
        type: Object,
        required: true
      }
    },

    data() {
      return {};
    },

    methods:{
      applyRetreat(){
        this.$emit('apply-retreat');
      }
    }
  };

</script>

<style lang="scss">
  .goods-order-activity {
    color: #2f3135;
    font-size: formatPx(26);

    >div {
      margin-bottom: formatPx(10);

      &:last-child {
        margin-bottom: 0;
      }
    }

    .goods-order-activity-btn {
      background: #fd5a3a;
      color: #ffffff;
      text-align: center;
      width: formatPx(180);
      height: formatPx(50);
      line-height: formatPx(50);
      border-radius: formatPx(25);
    }
  }

</style>
